/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * AdminGUI.java
 *
 * Created on Dec 20, 2011, 5:12:58 PM
 */
package Gui;

import Oracle.OracleMethods;
import java.io.*;
import java.sql.*;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author odmaestrams
 */
public class AdminGUI extends javax.swing.JFrame {
    
    /** Creates new form AdminGUI */
    public AdminGUI() {
        initComponents();      
        this.setLocationRelativeTo(null);
        this.salir_button.requestFocus();
    }    

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        ventaKioscos_button = new javax.swing.JButton();
        facturacion_button = new javax.swing.JButton();
        baseDatos_button = new javax.swing.JButton();
        reportes_button = new javax.swing.JButton();
        publicidad_button = new javax.swing.JButton();
        mantenimiento_button = new javax.swing.JButton();
        vallas_button = new javax.swing.JButton();
        salir_button = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Kioscos AO - Sistema de Administracion de Kioscos");

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Centro de Administracion"));

        ventaKioscos_button.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        ventaKioscos_button.setText("Venta Kioscos");
        ventaKioscos_button.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ventaKioscos_buttonActionPerformed(evt);
            }
        });

        facturacion_button.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        facturacion_button.setText("Facturacion");
        facturacion_button.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                facturacion_buttonActionPerformed(evt);
            }
        });

        baseDatos_button.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        baseDatos_button.setText("Base de datos");
        baseDatos_button.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                baseDatos_buttonActionPerformed(evt);
            }
        });

        reportes_button.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        reportes_button.setText("Reportes");
        reportes_button.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                reportes_buttonActionPerformed(evt);
            }
        });

        publicidad_button.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        publicidad_button.setText("Publicidad");
        publicidad_button.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                publicidad_buttonActionPerformed(evt);
            }
        });

        mantenimiento_button.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        mantenimiento_button.setText("Mantenimiento");
        mantenimiento_button.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mantenimiento_buttonActionPerformed(evt);
            }
        });

        vallas_button.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        vallas_button.setText("Vallas");
        vallas_button.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                vallas_buttonActionPerformed(evt);
            }
        });

        salir_button.setFont(new java.awt.Font("Tahoma", 0, 14));
        salir_button.setText("Salir");
        salir_button.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                salir_buttonActionPerformed(evt);
            }
        });

        org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                        .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(publicidad_button, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 176, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(ventaKioscos_button, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 176, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                        .add(mantenimiento_button, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 176, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                    .add(vallas_button, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 176, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .add(27, 27, 27)
                .add(jLabel1)
                .add(18, 18, 18)
                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(salir_button, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 176, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(reportes_button, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 176, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(facturacion_button, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 176, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(baseDatos_button, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 176, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel1Layout.createSequentialGroup()
                .add(19, 19, 19)
                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jPanel1Layout.createSequentialGroup()
                        .add(facturacion_button, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 52, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(baseDatos_button, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 52, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(reportes_button, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 52, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(salir_button, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 52, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                    .add(jPanel1Layout.createSequentialGroup()
                        .add(116, 116, 116)
                        .add(mantenimiento_button, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 52, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(vallas_button, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 52, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                    .add(jPanel1Layout.createSequentialGroup()
                        .add(ventaKioscos_button, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 52, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(jLabel1)
                            .add(publicidad_button, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 52, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))))
                .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .addContainerGap()
                .add(jPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .addContainerGap()
                .add(jPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

private void salir_buttonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_salir_buttonActionPerformed
    this.dispose();
}//GEN-LAST:event_salir_buttonActionPerformed

private void ventaKioscos_buttonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ventaKioscos_buttonActionPerformed
        try {
            new VentaKioscosGUI().setVisible(true);
        } catch (SQLException ex) {
            Logger.getLogger(AdminGUI.class.getName()).log(Level.SEVERE, null, ex);
        }
}//GEN-LAST:event_ventaKioscos_buttonActionPerformed

private void mantenimiento_buttonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mantenimiento_buttonActionPerformed
        try {
            new ManejoMantenimientoGUI("M").setVisible(true);
        } catch (SQLException ex) {
            System.out.println(ex);
        }
}//GEN-LAST:event_mantenimiento_buttonActionPerformed

private void vallas_buttonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_vallas_buttonActionPerformed
        try {
            new ManejoMantenimientoGUI("V").setVisible(true);
        } catch (SQLException ex) {
            System.out.println(ex);
        }
}//GEN-LAST:event_vallas_buttonActionPerformed

private void baseDatos_buttonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_baseDatos_buttonActionPerformed
        try {
            new BaseDatosGUI().setVisible(true);
        } catch (SQLException ex) {
            Logger.getLogger(AdminGUI.class.getName()).log(Level.SEVERE, null, ex);
            System.out.println("Error en la conexion");
        }
}//GEN-LAST:event_baseDatos_buttonActionPerformed

private void publicidad_buttonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_publicidad_buttonActionPerformed
    try {
            new PublicidadGUI().setVisible(true);
        } catch (SQLException ex) {
            System.out.println(ex);
        }
}//GEN-LAST:event_publicidad_buttonActionPerformed

private void reportes_buttonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_reportes_buttonActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_reportes_buttonActionPerformed

private void facturacion_buttonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_facturacion_buttonActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_facturacion_buttonActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(AdminGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(AdminGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(AdminGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(AdminGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {

            @Override
            public void run() {
                new AdminGUI().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton baseDatos_button;
    private javax.swing.JButton facturacion_button;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JButton mantenimiento_button;
    private javax.swing.JButton publicidad_button;
    private javax.swing.JButton reportes_button;
    private javax.swing.JButton salir_button;
    private javax.swing.JButton vallas_button;
    private javax.swing.JButton ventaKioscos_button;
    // End of variables declaration//GEN-END:variables
}
